package com.crm.service.impl.systemManager;

import com.crm.dao.mapper.customMapper.systemManager.ParameterSettingMapper;
import com.crm.dao.mapper.systemManager.SysParameterSettingMapper;
import com.crm.model.entity.systemManager.SysParameterSetting;
import com.crm.service.systemManager.ParameterSettingDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author:chaifuyou
 * @Date: 2021/4/21 10:13
 */
@Service
public class ParameterSettingDbServiceImpl implements ParameterSettingDbService {
    @Autowired
    private SysParameterSettingMapper sysParameterSettingMapper; //自动生成的

    @Autowired
    private ParameterSettingMapper parameterSettingMapper;

    /**
     * 删除系统配置
     * @param sysParameterSetting
     */
    @Override
    public void delSystemParameterSetting(SysParameterSetting sysParameterSetting) {
        parameterSettingMapper.deleteByPrimaryKey(sysParameterSetting.getSysParameterId());
    }

    @Override
    public void addSystemParameterSetting(SysParameterSetting sysParameterSetting) {
        sysParameterSettingMapper.insertSelective(sysParameterSetting);
    }

    /**
     * 修改系统设置
     * @param sysParameterSetting
     */
    @Override
    public void updateSystemParameterSetting(SysParameterSetting sysParameterSetting) {
        sysParameterSettingMapper.updateByPrimaryKeySelective(sysParameterSetting);
    }

    /**
     * 查询系统设置
     * @return
     */
    @Override
    public SysParameterSetting selectSystemParameterSetting() {
        return parameterSettingMapper.selectSystemParameterSetting();
    }
}
